import { createRouter, createWebHistory } from 'vue-router'

/* 1 推荐 */
//推荐歌单
const Recommendmusic=()=>import("../views/recommend/recommendmusic/Recommendmusic.vue");
const Recsonglist=()=>import("../views/recommend/recsonglist/Recsonglist.vue");
const Songrank=()=>import("../views/recommend/songrank/Songrank.vue");
const Singer=()=>import("../views/recommend/singer/Singer.vue");
const Newsongs=()=>import("../views/recommend/newsongs/Newsongs.vue");
const Recommend = () => import("../views/recommend/Recommend.vue");   
//歌单详情
const Songlistdetail = () => import("../views/songlistdetail/Songlistdetail.vue"); 
// 专辑详情
const Albumdetail = () => import("../views/zhuanjidetail/Albumdetail.vue");
//歌手详情
const Singerdetail=()=>import("../views/singerdetail/Singerdetail.vue");
/* 搜索详情页 */
const Searchdetail = () => import("../views/searchdetail/Searchdetail.vue");
const SongRes = () => import("../views/searchdetail/Childcomps/SongRes.vue");
const AlbumRes = () => import("../views/searchdetail/Childcomps/AlbumRes.vue");
const SingerRes = () => import("../views/searchdetail/Childcomps/SingerRes.vue");
const SongListRes = () => import("../views/searchdetail/Childcomps/SongListRes.vue");
const MvRes =() => import("../views/searchdetail/Childcomps/MvRes.vue");


 /* 2 视频 */
const Video = () => import("../views/video/Video.vue"); 
const video1= () => import("../views/video/Childcomps/video1.vue"); 
const Mv= () => import("../views/video/Childcomps/Mv.vue");
const VideoDetail = () => import("../views/videodetail/VideoDetail.vue");
 /* 3 电台 */
const Radio = () => import("../views/radio/Radio.vue");

/* 4 我喜欢 */
const Myfavorite = () => import("../views/myfavorite/MyFavorite.vue");
const FavoriteSongs=()=> import("../views/myfavorite/Childcomps/FavoriteSongs.vue");
const FavoriteAlbum=()=> import("../views/myfavorite/Childcomps/FavoriteAlbum.vue");
const FavoriteSinger=()=> import("../views/myfavorite/Childcomps/FavoriteSinger.vue");
const FavoriteSongsList=()=> import("../views/myfavorite/Childcomps/FavoriteSongsList.vue");
/* 5 本地下载 */
const Localsongs= () => import("../views/localsongs/Localsongs.vue");

/* 6 最近播放 */
const Recentplay = () => import("../views/recentplay/Recentplay.vue");

// const Singerdetail = () => import("../views/singerdetail/Singerdetail.vue"); 
// const Albumdetail = () => import("../views/albumdetail/Albumdetail.vue"); 

const routes = [
  /* 1 推荐 */
  {	
		path: "/",
		redirect: "/recommend",
	},
  {
    path: "/recommend",
    name: 'Recommend',
    component: Recommend,
    redirect: "/recommend/recommendmusic",
    children: [
			{
				path: "recommendmusic",
				name: "Recommendmusic",
				component: Recommendmusic,
			},
			{
				path: "recsonglist",
				name: "Recsonglist",
				component: Recsonglist,
			},
			{
				path: "songrank",
				name: "Songrank",
				component: Songrank,
			},
			{
				path: "singer",
				name: "Singer",
				component: Singer,
			},
			{
				path: "newsongs",
				name: "Newsongs",
				component: Newsongs,
			},
		],
    
  },

  
  /* 歌单详情 */
	{
		path: "/songlistdetail/:id",
		name: "Songlistdetail",
		component: Songlistdetail,
	},
	/* 歌手详情 */
	{
		path: "/singerdetail/:id",
		name: "Singerdetail",
		component: Singerdetail,
	},
	/* 专辑详情 */
	{
		path: "/albumdetail/:id",
		name: "Albumdetail",
		component: Albumdetail,
	},


/* 搜索详情*/
{
  path: "/searchdetail",
  component: Searchdetail,
  redirect: { name: "SongRes" },  
  children: [
    {
      path: "songres/:keywords",  
      name: "SongRes",
      component: SongRes,
      props: true, 
    },
    {
      path: "singerres/:keywords",  
      name: "SingerRes",
      component: SingerRes,
      props: true, 
    },
    {
      path: "albumres/:keywords",
      name: "AlbumRes",
      component: AlbumRes,
      props: true,
    },
    {
      path: "mvres/:keywords",
      name: "MvRes",
      component: MvRes,
    },
    {
      path: "songlistres/:keywords",  
      name: "SongListRes",
      component: SongListRes,
      props: true, 
    },
  ],
},



   /* 2、视频 */
	{
		path: "/video",
		component: Video,
		name: "video",
		redirect: "/video/mv",
		children: [
			{
				path: "mv",
				name: "Mv",
				component: Mv,
			},
			{
				path: "video1",
				name: "Video1",
				component: video1,
			},
		],
	},

	/* 视频详情 */
	{
		path: "/videolistdetail/:id/:type",
		name: "VideoDetail",
		component: VideoDetail,
	},
  /* 3、电台*/
  {
    path: "/Radio",
    name: "Radio",
    component: Radio,
  },
 /* 4、我喜欢*/
 {
  path: "/myfavorite",
  name: "myfavorite",
  component: Myfavorite,
  redirect: "/myfavorite/songs",
    children: [
      {
        path: "/myfavorite/songs",
        name: "favoritesongs",
        component: FavoriteSongs,
      },
    {
      path: "/myfavorite/album",
      name: "favoritealbum",
      component: FavoriteAlbum,
    },
    {
      path: "/myfavorite/singer",
      name: "favoritesinger",
      component: FavoriteSinger,
    },
    {
      path: "/myfavorite/songslist",
      name: "favoritesongslist",
      component: FavoriteSongsList,
    },
  ],
},

 /* 5、本地歌曲*/
 {
  path: "/Localsongs",
  name: "localsongs",
  component: Localsongs,
},
 /* 6、最近播放*/
 {
  path: "/Recentplay",
  name: "recentplay",
  component: Recentplay,
},
 
]


/* 搜索详情页 */




const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})
export default router
